/**
 * 
 */
package controllers;

import java.util.List;

import client.gui.panels.PanelIF;
import entities.Message;
import entities.Ticket;
import entities.User;

/**
 * @author Vodi
 *
 */
public class ViewTicketController implements ControllerIF {

	/**
	 * the view ticket panel
	 */
	private PanelIF viewTicketPanel;

	/**
	 * the main panel controller
	 */
	private MainPanelController mainPanelController;

	/**
	 * reference for the inner panel's controller
	 */
	private ControllerIF innerPanelController;
	
	/**
	 * A structure to hold all the information about a specific ticket  
	 */
	private Ticket ticket;
	
	
	public ViewTicketController(MainPanelController mainPanelController) {
		this.mainPanelController = mainPanelController;
	}
	
	
	/**
	 * Get the connected user details
	 * @return User object
	 */
	public User getUser() {
		return mainPanelController.getUser();
	}
	
	/* (non-Javadoc)
	 * @see controllers.ControllerIF#getPanel()
	 */
	@Override
	public PanelIF getPanel() {
		return viewTicketPanel;
	}

	/* (non-Javadoc)
	 * @see controllers.ControllerIF#action()
	 */
	@Override
	public void action() {}

	/* (non-Javadoc)
	 * @see controllers.ControllerIF#decipherMessage(entities.Message)
	 */
	@Override
	public void decipherMessage(Message message) {
		
	}


	@Override
	public void setPanel(PanelIF panel) {
		viewTicketPanel = panel;
	}



	/**
	 * @return the innerPanelController
	 */
	public ControllerIF getInnerPanelController() {
		return innerPanelController;
	}
	


	/**
	 * @param innerPanelController the innerPanelController to set
	 */
	public void setInnerPanelController(ControllerIF innerPanelController) {
		this.innerPanelController = innerPanelController;
	}

	/**
	 * Try sending a message to server
	 * @param message Message
	 */
	public void sendMessage(Message message) {
		mainPanelController.sendMessage(message);
	}

	/**
	 * Get the committee chairman
	 * @return User
	 */
	public User getCommitteeChairmam() {
		return mainPanelController.getCommitteeChairmam();
	}

	/**
	 * Get a list of the committee members (chairman not included)
	 * @return List<User>
	 */
	public List<User> getCommitteeMembers() {
		return mainPanelController.getCommitteeMembers();
	}
	




}
